<template>
  <div v-if="isEnd" id="model">
    <div class="modal timeout-modal">
      <div class="modal-mask"></div>
      <div class="modal-box">
        <div class="modal-head"></div>
        <div class="modal-body">
          <i class="icon icon-ecom"></i>
          <div class="modal-content">
            <p>已超过支付时间, 该订单自动取消!</p>
            <div class="modal-btn-group">
              <button @click="Reorder()" class="btn modal-btn-ok">
                返回重新下单
              </button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
  name: 'TtmsExpire',

  data () {
    return {}
  },
  props: {
    isEnd: {
      type: Boolean,
      default: false
    }
  },
  computed: {
    ...mapState('order', ['order'])
  },
  mounted () {},

  methods: {
    Reorder () {
      // 跳转到seats页面并携带mId和pId
      this.$router.push({
        path: '/seats',
        query: { mId: this.order.mId, pId: this.order.pId }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
* {
  box-sizing: content-box;
}
.modal,
.modal-mask {
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100;
}
.modal-mask {
  position: absolute;
  background: #000;
  background: rgba(0, 0, 0, 0.2);
  filter: alpha(opacity=20);
}
.timeout-modal .modal-box {
  width: 400px;
  height: 246px;
  margin: -123px 0 0 -200px;
}
.modal-box {
  top: 50%;
  left: 50%;
  z-index: 101;
  overflow: hidden;
  position: absolute;
  border: 6px solid #bbb;
  background-color: #fff;
  -webkit-animation: scale-in both cubic-bezier(0.4, 0, 0, 1.5) 0.3s;
  animation: scale-in both cubic-bezier(0.4, 0, 0, 1.5) 0.3s;
}
.modal-head {
  height: 40px;
  position: relative;
  background-color: #f7f7f7;
}
.modal-body {
  margin: 40px;
  position: relative;
}
.modal-btn-group .btn {
  font-weight: 700;
  padding: 7px 20px 6px;
}
.icon,
.icon-sand {
  display: inline-block;
}
.icon {
  font-size: 0;
  background-image: url(https://s3.meituan.net/static-prod01/com.sankuai.fspfepayresource.front.pccashier/img/icon-common@2x.rcJBe.png);
  background-size: 168px;
}
.modal-content {
  padding-left: 90px;
}
.modal-content p {
  margin: 0;
  line-height: 20px;
}
.timeout-modal p {
  padding: 25px 0;
}
.modal-btn-group {
  margin: 15px 0 20px;
}
.timeout-modal .btn {
  width: 130px;
  border-radius: 100px;
  padding-left: 0;
  padding-right: 0;
  margin-left: 12px;
}

.modal-btn-ok {
  margin-right: 15px;
}
.btn {
  background-color: #f90;
  background-image: linear-gradient(180deg, #ffa114, #f59300);
}
.icon-ecom {
  top: 5px;
  left: 5px;
  width: 60px;
  height: 60px;
  position: absolute;
}
.btn,
.btn-primary {
  color: #fff;
  border: none;
  cursor: pointer;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
  border-radius: 2px;
  letter-spacing: 2px;
  padding: 5px 12px 4px;
  display: inline-block;
  -webkit-font-smoothing: antialiased;
}
button,
html input[type="button"],
input[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
}
button,
select {
  text-transform: none;
}
button {
  overflow: visible;
}
button,
input,
select,
textarea {
  margin: 0;
  font: inherit;
  color: inherit;
}
button,
input[type="button"],
input[type="submit"] {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}
a,
button,
input,
select {
  padding: 0;
}
</style>
